package com.zhuoyue.system.service.impl;

import java.util.List;

import com.zhuoyue.common.annotation.DataScope;
import com.zhuoyue.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhuoyue.system.mapper.TblGroupMapper;
import com.zhuoyue.system.domain.TblGroup;
import com.zhuoyue.system.service.ITblGroupService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author wjming
 * @date 2021-09-06
 */
@Service
public class TblGroupServiceImpl implements ITblGroupService {
    @Autowired
    private TblGroupMapper tblGroupMapper;

    /**
     * 查询群组信息
     *
     * @param id
     * @return 群组信息
     */
    @Override
    public TblGroup selectTblGroupById(String id) {
        return tblGroupMapper.selectTblGroupById(id);
    }

    /**
     * 查询群组信息
     *
     * @param tblGroup
     * @return 群组信息
     */
    @Override
    @DataScope(deptAlias = "s_d")
    public List<TblGroup> selectTblGroupList(TblGroup tblGroup) {
        return tblGroupMapper.selectTblGroupList(tblGroup);
    }

    /**
     * 新增群组信息
     *
     * @param tblGroup
     * @return 群组信息
     */
    @Override
    public int insertTblGroup(TblGroup tblGroup) {
        tblGroup.setCreateTime(DateUtils.getNowDate());
        return tblGroupMapper.insertTblGroup(tblGroup);
    }

    /**
     * 修改群组信息
     *
     * @param tblGroup
     * @return 1
     */
    @Override
    public int updateTblGroup(TblGroup tblGroup) {
        return tblGroupMapper.updateTblGroup(tblGroup);
    }

    /**
     * 批量删除
     *
     * @param ids
     * @return 1
     */
    @Override
    public int deleteTblGroupByIds(String[] ids) {
        return tblGroupMapper.deleteTblGroupByIds(ids);
    }

    /**
     * 删除群组信息
     *
     * @param id
     * @return 1
     */
    @Override
    public int deleteTblGroupById(String id) {
        return tblGroupMapper.deleteTblGroupById(id);
    }
}
